<template>
    <model title="Taxomony Tree">

        <div id="tree" class="col-sm-5" style="height: 600px;
                overflow: auto;"></div>

    </model>
</template>

<script>



    export default {
        name: "tree",
        mounted() {
            loadJs("/assets/bootstrap-treeview/tree.js")

            loadJs("/assets/bootstrap-treeview/bootstrap-treeview.js",function () {
                axios.post("/PTSG/germ/getTreeData").then(res=>{
                    $('#tree').treeview({
                        data: res.data,         // 数据源
                        highlightSelected: true,    //是否高亮选中
                        emptyIcon: '',   //没有子节点的节点图标
                        multiSelect: false,    //多选
                        expandIcon: "fa fa-plus",
                        collapseIcon:"fa fa-minus",
                        selectedBackColor: 'undefined',
                        selectedColor: 'undefined',
                        showTags: true,
                        levels: 1
                    });
                })
            });
        }
    }
</script>

<style lang="scss">

    .list-group-item{
        color: #212529;
        .badge{
            float: right;
            background-color: #777;
            border-radius: 10px;
            min-width: 30px;
            color: #fff;
            font-size: 12px;
            margin-top: 7px;
        }
    }

</style>